package com.webapp.dao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import com.webapp.domain.entity.UserDetail;

@Repository("userDetailDAO")
public class UserDetailDAO extends AbstractDAO<UserDetail>{

	public void insertUserDetail(UserDetail userDetail){
		save(userDetail);
	}
	
	public UserDetail selectUserDetail(Map<String, Object> map){
		List<Object> list = new ArrayList<Object>();
		String sql = "where 1=1 ";
	
		for(String key : map.keySet()){

	
			sql += "and "+key+"=? ";
			list.add(map.get(key));
		}
		return get(sql, list.toArray());
	}
	
//	public void updateUserDetail(UserDetail userDetail){
//		Session session = getSession();
//		session.update(userDetail);
//		
//	}
	
}
